<?php

namespace frontend\models\WebsiteUrl;

use Yii;

/**
 * This is the model class for table "website_url".
 *
 * @property integer $id
 * @property string $website
 * @property integer $spider_able
 * @property integer $created_at
 * @property integer $updated_at
 */
class WebsiteUrl extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'website_url';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        $time_now = strtotime(date('Y-m-d H:i:s'));
        return [
            [['spider_able', 'created_at', 'updated_at'], 'integer'],
            [['website'], 'string', 'max' => 100],
            ['spider_able', 'default', 'value' => 1],
            ['created_at', 'default', 'value'=>"$time_now"],
            ['updated_at', 'default', 'value'=>"$time_now"],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'website' => '网址',
            'spider_able' => '可抓取状态',
            'created_at' => '创建时间',
            'updated_at' => '最后抓取时间',
        ];
    }
}
